//
//  RBFactoryMethod.h
//  FMLApp
//
//  Created by Riber on 2017/4/1.
//  Copyright © 2017年 Riber. All rights reserved.
//  工厂化方法--> 这里只初始化控件 事件不在这里添加

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface RBFactoryMethod : NSObject

NS_ASSUME_NONNULL_BEGIN
// 添加设置文字属性 12132016
+ (UILabel *)initWithLabelFrame:(CGRect)frame andTextAlignment:(NSTextAlignment)textAlignment andTextColor:(UIColor *)color fontOfSystemSize:(CGFloat)fontSize isBold:(BOOL)isBold;

// label masonry
+ (UILabel *)initWithMasonryLabelTextAlignment:(NSTextAlignment)textAlignment andTextColor:(UIColor *)color fontOfSystemSize:(CGFloat)fontSize isBold:(BOOL)isBold;

// imageView 正常的
+ (UIImageView *)initWithNormalImageViewFrame:(CGRect)frame andImageName:(NSString *)name;

// imageView masonry
+ (UIImageView *)initWithNormalMasonryImageViewWithImageName:(NSString *)imageName;

// 新手引导
+ (void)initWithGuideImageViewTarget:(id)target Name:(NSString *)imageName buttonFrame:(CGRect)frame;

// 横的分割线
+ (UIView *)initWithLineViewFrame:(CGRect)frame;

/**
 正常不带图片的UIButton

 @param frame button frame
 @param title button title
 @param color button color
 @param fontSize button title fontSize
 @return button
 */
+ (UIButton *)initWithNormalButtonFrame:(CGRect)frame title:(NSString *)title titleColor:(UIColor *)color fontOfSystemSize:(CGFloat)fontSize;

/**
 正常只有图片的UIButton

 @param frame button frame
 @param normalImageName button normalImageName
 @param selectImageName button selectImageName
 @return button
 */
+ (UIButton *)initWithNormalImageButtonFrame:(CGRect)frame normalImageName:(NSString *)normalImageName selectImageName:(NSString *)selectImageName;


// textField
+ (UITextField *)initWithTextFieldFrame:(CGRect)frame textAlignment:(NSTextAlignment)textAlignment textColor:(UIColor *)color placeHoder:(NSString *)placeHoder fontOfSystemSize:(CGFloat)fontSize;

// textField masonry
+ (UITextField *)initWithMasonryTextFieldTextAlignment:(NSTextAlignment)textAlignment textColor:(UIColor *)color placeHoder:(NSString *)placeHoder fontOfSystemSize:(CGFloat)fontSize;

+ (NSMutableAttributedString *)addAttributed:(NSString *)oldString attributes:(NSDictionary *)attributesDic range:(NSRange)range;

// 提示用的 alertView
+ (void)alertViewOrControllerShow:(NSString *)alertString viewController:(UIViewController *)viewController;

/**
 * 带有确定，取消的提示框
 */
+ (void)alertWithTitle:(NSString *)title message:(NSString *)message forViewController:(UIViewController *)viewController okHandler:(void (^ __nullable)(UIAlertAction *action))okHandler cancelHandler:(void (^ __nullable)(UIAlertAction *action))cancelHandler;

// 通过name或version或build 获取app名称或版本号或构建版本
/**
 * 通过name或version获取app名称或版本号
 * key = name or version or build
 */
+ (NSString *)getAppInfoWithAppNameOrVersionOrBuild:(NSString *)type;

+ (void)callPhone:(NSString *)phone showView:(UIView *)showView;

NS_ASSUME_NONNULL_END

@end
